	@extends('admin.base')

        @section('content')
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            <i class="fa fa-calendar"></i>
			网站配置
          </h1>
          <ol class="breadcrumb">
            <li><a href="{{url('admin')}}"><i class="fa fa-dashboard"></i>首页</a></li>
            <li><a href="{{url('admin/config')}}">网站配置</a></li>
            <li class="active">网站配置修改</li>
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <!-- right column -->
            <div class="col-md-12">
              <!-- Horizontal Form -->
              <div class="box box-primary">
                <div class="box-header with-border">
                  <h3 class="box-title"><i class="fa fa-plus"></i> 网站配置修改</h3>
                </div><!-- /.box-header -->
                <!-- form start -->
				
                <form action="{{url('admin/config')}}/{{$list->id}}" method="post" class="form-horizontal" enctype="multipart/form-data">
                  <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                  <input type="hidden" name="_method" value="PUT">
                  <input type="hidden" name="filename" value="{{$list->logo}}">
				  
                  <div class="box-body">
                    <div class="form-group">
                      <label for="inputEmail3" class="col-sm-2 control-label">网站名称：</label>
                      <div class="col-sm-4">
                        <input type="name" name="name" value="{{$list->name}}" class="form-control" id="inputEmail3" placeholder="网站名称">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputPassword3" class="col-sm-2 control-label">关键字：</label>
                      <div class="col-sm-4">
                        <input type="text" name="keywords" value="{{$list->keywords}}" class="form-control" id="inputPassword3" placeholder="关键字">
                      </div>
                    </div>
					
					<div class="form-group">
                      <label for="inputPassword3" class="col-sm-2 control-label">网站logo：</label>
                      <div class="col-sm-4">
						<div id="preview"></div>
                        <input type="file" onchange="preview(this)" id="up_img" name="ufile" src="./uploads/{{$list->logo}}" class="form-control" id="inputPassword3" placeholder="logo">
						
                        <input type="hidden" name="pname" value="{{$list->logo}}" />
                      </div>
                    </div>
					<div class="form-group">
                      <label for="inputPassword3" class="col-sm-2 control-label">网站状态：</label>
                      <div class="col-sm-4">
						
                        <input type="radio"  name="status" value="1" {{$list->status==1?'checked':''}}>开启  &nbsp; &nbsp; 
						
                        <input type="radio"  name="status" value="0" {{$list->status==0?'checked':''}}>关闭 
						
                      </div>
                    </div>
                  </div><!-- /.box-body -->
                  <div class="box-footer">
				    <div class="col-sm-offset-2 col-sm-1">
						<button type="submit" class="btn btn-primary">确定修改</button>
                    </div>
					<div class="col-sm-1">
						<button type="reset" class="btn btn-primary">重置</button>
					</div>
                  </div><!-- /.box-footer -->
                </form>
				
				<div class="row"><div class="col-sm-12">&nbsp;</div></div>
              </div><!-- /.box -->
       
            </div><!--/.col (right) -->
          </div>   <!-- /.row -->
        </section><!-- /.content -->
        @endsection
		@section('myscript')
		<script type="text/javascript">    
			 function preview(file)  
			 {  
			 var prevDiv = document.getElementById('preview');  
			 if (file.files && file.files[0])  
			 {  
			 var reader = new FileReader();  
			 reader.onload = function(evt){  
			 prevDiv.innerHTML = '<img src="' + evt.target.result + '" />';  
			}    
			 reader.readAsDataURL(file.files[0]);  
			}  
			 else    
			 {  
			 prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';  
			 }  
			 }  
		</script>  
		@endsection